using System;
using System.Xml;
using IniFileManager;


namespace IniFileManagerProgram
{
	class Program
	{
		static void Main( string[] args )
		{
            // Loading ini schema:
            IniSchema iniSchema2 = new IniSchema(new System.IO.FileStream("example02.xml", System.IO.FileMode.Open)); 
            // Loading ini data:
			IniData configuration = IniParser.LoadIni( new System.IO.FileStream( "example02.ini", System.IO.FileMode.Open ), IniLoadOptions.Relaxed, iniSchema2 );

            // Changing value of [0] element in "router" property, "general" section:
            configuration.Sections["general"].Properties["router"].Elements[0].Value = "192.168.10.2";

            // Saving, directed to console:
			IniParser.SaveIniToTextWriter( configuration, Console.Out );
            
		}
	}
}
